package com.ym.soso.enums;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.StdConverter;
import com.ym.common.annotations.EnumDescription;
import com.ym.common.constant.DictEnum;


@EnumDescription("机构性质")
public enum PropertyEnum implements DictEnum {

    //--------------------start-----------------


    PUBLIC("01", "公办"),

    PRIVATE("02", "民办"),

    PRIVATE_PUBLISH("03", "民办公助"),

    PUBLIC_CONSTRUCTION("04", "公建民营"),
    //--------------------end-------------------
    ;

    private String key;

    private String value;

    PropertyEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public String getKey() {
        return this.key;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    /**
     * 序列化使用
     */
    public static class Covert extends StdConverter<String, JSONObject> {
        @Override
        public JSONObject convert(String value) {
            return DictEnum.valueOfJson(PropertyEnum.class, value);
        }
    }
}
